<template>
	<view class="">
		<view class="f-1">
		<!-- 	<nav-tab color="#ff3a48" :isscroll='true' itw='100%' ncolor='#707070' ifsize="32"
				:isname="{fontSize:'34rpx',fontWeight:'bold'}" v-model="aIdx" @changeTab='changeTab'
				:tabs='tabs'></nav-tab> -->
		</view>
		<!-- <view class="t-c p10 c9">我的钱包：<text class="mr10">￥{{user.balance || 0.00 }}</text> 累计支出：￥{{result.expenditure || 0.00}}</view> -->
		<view class="cmymain p3">
			<DetailList :data="dataList"  />
			<jzz bgcolor="transparent" imgn='zwhb' :nodata="dataList.length==0&&isget" :mygd='mygd' />
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from 'vuex'
	import navTab from '@/components/common/functionCmp/nav-tab.vue'
	import DetailList from './components/DetailList.vue'
	import jzz from '@/components/common/jzz.vue'
	import {
		sljz
	} from "@/common/util-mixins.js"
	export default {
		name: 'myCoupon',
		components: {
			navTab,
			DetailList,
			jzz
		},
		data() {
			return {
				aIdx: 0,
				dataList: [],
				result:{},
				params: {
					size: 10,
					page: 1,
				},
			}
		},
		async onLoad(options) {
			this.getSystem()
			this.util.setNT('提现概况')
			this.getList()
			this.isOnLoad = false
		},
		onShow() {
			if (this.isOnLoad) {
				this.refresh();
			}
		},
		mixins: [sljz],
		computed: {
			tabs() {
				return [{
					name: '提现概况',
				}]
			}
		},
		methods: {
			changeTab(e) {
				this.isget = this.mygd = false
				this.params.page = 1
				this.params.type = this.tabs[e].type // 1收入 2支出
				this.dataList = []
				this.getList()
			},
			refresh() {
				this.getList()
			},
			async getList() {
				this.isOnLoad = true
				let {
					data
				} = await this.util.request({
					'url': this.api.withdrawalList,
					method: 'POST',
					data: this.params,
				})
				this.result = data
				this.dataList = this.dataList.concat(data)
				this.isget = true
				this.mygd = this.params.size > data.length
				this.params.page++
			}
		},
	}
</script>

<style scoped lang="scss">
	.cmymain {
		background: #fff;
		padding-top: 0;
	}

	.stabsc {
		height: 90rpx;
	}
</style>
